package STUDENT.TranNamAnh.OOPs.baitap4;


public class Models {
	int soNgay = 0;
	public int modelSoNgay(Object obj){
		if(obj.getThang() == 1 || obj.getThang() == 3 ||
				obj.getThang() ==5 || obj.getThang() ==7 ||obj.getThang() == 8 ||
				obj.getThang() == 10 || obj.getThang() == 12)
		soNgay = 31;
		
		if(obj.getThang() == 9 || obj.getThang() == 4 ||
				obj.getThang() ==6 || obj.getThang() ==11 )
		soNgay = 30;
		
		if(obj.getThang() ==2)
			if(obj.getNam() % 100 != 0 || obj.getNam() % 4 == 0 || obj.getNam() % 400 == 0)
				soNgay = 29;
		
		
		return soNgay;
		
	}
}

